<html>
 <head>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <title>
   主题：MAP因子抽取法的语句  | 数螺 | NAUT IDEA
  </title>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" rel="stylesheet"/>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
  <style type="text/css">
   #xmain img {
                  max-width: 100%;
                  display: block;
                  margin-top: 10px;
                  margin-bottom: 10px;
                }

                #xmain p {
                    line-height:150%;
                    font-size: 16px;
                    margin-top: 20px;
                }

                #xmain h2 {
                    font-size: 24px;
                }

                #xmain h3 {
                    font-size: 20px;
                }

                #xmain h4 {
                    font-size: 18px;
                }


                .header {
	           background-color: #0099ff;
	           color: #ffffff;
	           margin-bottom: 20px;
	        }

	        .header p {
                  margin: 0px;
                  padding: 10px 0;
                  display: inline-block;  
                  vertical-align: middle;
                  font-size: 16px;
               }

               .header a {
                 color: white;
               }

              .header img {
                 height: 25px;
              }
  </style>
  <script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js">
  </script>
  <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript">
   MathJax.Hub.Config({elements: ["bbpress-forums"]});
  </script>
  <script src="http://nautstatic-10007657.file.myqcloud.com/static/css/readability.min.js" type="text/javascript">
  </script>
  <script type="text/javascript">
   $(document).ready(function() {
                 var loc = document.location;
                 var uri = {
                  spec: "http://cos.name/cn/topic/2226/",
                  host: "http://cos.name",
                  prePath: "http://cos.name",
                  scheme: "http",
                  pathBase: "http://cos.name/"
                 };
    
                 var documentClone = document.cloneNode(true);
                 var article = new Readability(uri, documentClone).parse();
     
                 document.getElementById("xmain").innerHTML = article.content;
                });
  </script>
  <!-- 1466446993: Accept with keywords: (title(0.25):语句,因子,主题,论坛, topn(0.166666666667):RSS订阅,软件应用,因素,帖子,作者,会员,变量名,文件,用户名,主站,新鲜事,数理统计,括号,方法,东东,版权所有,菜单,顺带,空格,密码,普通,样本量,相关矩阵,语句,主题,程序,总计,因子,论坛,讨论区).-->
 </head>
 <body class="topic bbpress single single-topic postid-2226 single-author sidebar" onload="">
  <div class="header">
   <div class="container">
    <div class="row">
     <div class="col-xs-6 col-sm-6 text-left">
      <a href="/databee">
       <img src="http://nautidea-10007657.cos.myqcloud.com/logo_white.png"/>
      </a>
      <a href="/databee">
       <p>
        数螺
       </p>
      </a>
     </div>
     <div class="hidden-xs col-sm-6 text-right">
      <p>
       致力于数据科学的推广和知识传播
      </p>
     </div>
    </div>
   </div>
  </div>
  <div class="container text-center">
   <h1>
    主题：MAP因子抽取法的语句
   </h1>
  </div>
  <div class="container" id="xmain">
   <div class="hfeed site" id="page">
    <header class="site-header" id="masthead" role="banner">
     <div id="cos-logo">
      <a href="http://cos.name/cn">
       <img src="http://cos.name/cn/wp-content/themes/COS-forest/images/headers/cos-logo.png"/>
      </a>
     </div>
     <div class="navbar" id="navbar">
      <nav class="navigation main-navigation" id="site-navigation" role="navigation">
       <h3 class="menu-toggle">
        菜单
       </h3>
       <div class="menu-%e8%8f%9c%e5%8d%951-container">
        <ul class="nav-menu" id="menu-%e8%8f%9c%e5%8d%951">
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-407772" id="menu-item-407772">
          <a href="http://cos.name/cn/">
           论坛首页
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407773" id="menu-item-407773">
          <a href="http://cos.name/cn/forums/">
           讨论区
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407774" id="menu-item-407774">
          <a href="http://cos.name/cn/wp-login.php?action=register">
           注册
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407819" id="menu-item-407819">
          <a href="http://cos.name/">
           主站
          </a>
         </li>
        </ul>
       </div>
      </nav>
      <!-- #site-navigation -->
     </div>
     <!-- #navbar -->
    </header>
    <!-- #masthead -->
    <div class="site-main" id="main">
     <div class="content-area" id="primary">
      <div class="site-content" id="content" role="main">
       <article class="post-2226 topic type-topic status-publish hentry" id="post-2226">
        <header class="entry-header">
         <h1 class="entry-title">
          MAP因子抽取法的语句
         </h1>
        </header>
        <!-- .entry-header -->
        <div class="entry-content">
         <div id="bbpress-forums">
          <div class="bbp-breadcrumb">
           <p>
            <a class="bbp-breadcrumb-home" href="http://cos.name/cn/">
             COS论坛 | 统计之都
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <a class="bbp-breadcrumb-root" href="http://cos.name/cn/forums/">
             讨论区
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <a class="bbp-breadcrumb-forum" href="http://cos.name/cn/forum/software/">
             软件应用
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <a class="bbp-breadcrumb-forum" href="http://cos.name/cn/forum/software/spss/">
             SPSS
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <span class="bbp-breadcrumb-current">
             MAP因子抽取法的语句
            </span>
           </p>
          </div>
          <div class="bbp-template-notice info">
           <p class="bbp-topic-description">
            该主题包含 6 条回复，2个帖子，最后由
            <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
             <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=14&amp;d=monsterid&amp;r=g"/>
            </a>
            <a class="bbp-author-name" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
             谢益辉
            </a>
            在
            <a href="http://cos.name/cn/topic/2226/#post-212653" title="回复：MAP因子抽取法的语句">
             9 年, 7 月 之前
            </a>
            更新。
           </p>
          </div>
          <div class="bbp-pagination">
           <div class="bbp-pagination-count">
            查看 7 个帖子 - 1 到 7（总计 7 个）
           </div>
           <div class="bbp-pagination-links">
           </div>
          </div>
          <ul class="forums bbp-replies" id="topic-2226-replies">
           <li class="bbp-header">
            <div class="bbp-reply-author">
             作者
            </div>
            <!-- .bbp-reply-author -->
            <div class="bbp-reply-content">
             帖子
            </div>
            <!-- .bbp-reply-content -->
           </li>
           <!-- .bbp-header -->
           <li class="bbp-body">
            <div class="bbp-reply-header" id="post-2226">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2006年10月19日 上午5:00
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/2226/#post-2226">
               1 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-2226 -->
            <div class="odd bbp-parent-forum-997 bbp-parent-topic-2226 bbp-reply-position-1 user-id-3142 topic-author post-2226 topic type-topic status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/3142/" rel="nofollow" title="查看cartoon的档案">
               <img src="http://sdn.geekzu.org/avatar/0f8fbfae31d30bb6d0b5e733e2361a2f?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/3142/" rel="nofollow" title="查看cartoon的档案">
               cartoon
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               谢老大，这就是我之前问的那个东东的程序，顺带贴出来跟大家分享一下
              </p>
              <p>
               就是因素分析中确认因子抽取个数的方法之一
              </p>
              <p>
               下一个帖子是现在流行的另一种方法：平行分析法的语句。同共享
              </p>
              <p>
               Velicer's Minimum Average Partial (MAP) Test
               <br/>
               下面是MAP检验，我试验过用相关矩阵带入来算，感觉挺好的。当然也可以用程序里面推荐的相关文件，但目前我还没有学会。
              </p>
              <p>
               需要注意的是相关矩阵的数字之间用","和空格隔开，并且最后的1和括号之间没有空格。就是这个空格，搞了我一个小时才知道要去掉。
              </p>
              <p>
               一点比较奇怪，就是程序上没有确定样本量的选项。
              </p>
              <p>
               set printback=none width=80  seed = 1953125.
              </p>
              <p>
               *  Velicer's Minimum Average Partial (MAP) Test.
               <br/>
               *  There are two ways of running this program:
               <br/>
               *  Method 1: You can enter a correlation matrix directly
               <br/>
               into the program (i.e., without having SPSS save and then
               <br/>
               read a matrix out file), as in the example below for
               <br/>
               Harman's data.  Simply use the command COMPUTE CR =
               <br/>
               to enter and name the data, as in the example.
               <br/>
               *  Method 2: You can have the program read a correlation
               <br/>
               matrix that was saved by an SPSS procedure, as in the
               <br/>
               following examples:
               <br/>
               *  correlation  var1 to var25
               <br/>
               / matrix out ('C:\data.cor')  / missing = listwise.
               <br/>
               *  factor var= var1 to var25
               <br/>
               / matrix out (cor = 'C:\data.cor').
               <br/>
               *  You must then use the same MATRIX OUT filename
               <br/>
               (e.g., 'C:\data.cor') in the MGET command within the
               <br/>
               program itself.  These commands are now merely
               <br/>
               comments and will not run unless the "*"s in the
               <br/>
               first collumns are removed.  Any other COMPUTE CR =
               <br/>
               statements must also be removed from the program
               <br/>
               (e.g., remove Harman's data in the example below).
               <br/>
               matrix.
               <br/>
               *  activate the next MGET command to read a correlation
               <br/>
               matrix created by SPSS.
               <br/>
               * MGET /type= corr /file='C:\data.cor' .
               <br/>
               * Harman's data (1967, p 80).
               <br/>
               compute cr = {
               <br/>
               1,  .340,  .474,  .375,  .353,  .303,  .340,  .204,  .067,  .205,  .157,  .082,  .121,  .271,  .167,  .172,  .197,  .257,  .256,  .258,    .253 ;
               <br/>
               .340,  1,  .445,  .261,  .336,  .271,  .261,  .338,  .122,  .255,  .187,  .270,  .104,  .115,  .085,  .186,  .232,  .356,  .363,  .360,  .285;
               <br/>
               .474,  .445,  1,  .416,  .344,  .388,  .402,  .239,  .157,  .261,  .203,  .220,  .154,  .208,  .218,  .208,  .245,  .259,  .336,  .222,  .277;
               <br/>
               .375,  .261,  .416,  1,  .307,  .303,  .295,  .192,  .059,  .253,  .230,  .228,  .276,  .402,  .319,  .302,  .266,  .283,  .267,  .203,  .238;
               <br/>
               .353,  .336,  .344,  .307,  1,  .443,  .464,  .148,  .183,  .260,  .169,  .301,  .274,  .222,  .304,  .184,  .361,  .395,  .407,  .352,  .313;
               <br/>
               .303,  .271,  .388,  .303,  .443,  1,  .568,  .128,  .122,  .305,  .182,  .280,  .301,  .243,  .212,  .168,  .312,  .344,  .308,  .318,  .417;
               <br/>
               .340,  .261,  .402,  .295,  .464,  .568,  1,  .083,  .065,  .272,  .074,  .290,  .323,  .157,  .137,  .186,  .308,  .381,  .248,  .344,  .318;
               <br/>
               .204,  .338,  .239,  .192,  .148,  .128,  .083,  1,  .534,  .321,  .339,  .324,  .109,  .267,  .177,  .240,  .176,  .245,  .154,  .211,  .134;
               <br/>
               .067,  .122,  .157,  .059,  .183,  .122,  .065,  .534,  1,  .437,  .311,  .335,  .076,  .138,  .120,  .219,  .133,  .184,  .236,  .266,  .089;
               <br/>
               .205,  .255,  .261,  .253,  .260,  .305,  .272,  .321,  .437,  1,  .518,  .532,  .166,  .265,  .197,  .343,  .359,  .411,  .454,  .384,  .333;
               <br/>
               .157,  .187,  .203,  .230,  .169,  .182,  .074,  .339,  .311,  .518,  1,  .437,  .171,  .312,  .196,  .331,  .327,  .286,  .414,  .316,  .343;
               <br/>
               .082,  .270,  .220,  .228,  .301,  .280,  .290,  .324,  .335,  .532,  .437,  1,  .126,  .252,  .171,  .254,  .232,  .369,  .377,  .390,  .290;
               <br/>
               .121,  .104,  .154,  .276,  .274,  .301,  .323,  .109,  .076,  .166,  .171,  .126,  1,  .421,  .529,  .460,  .352,  .258,  .216,  .210,  .188;
               <br/>
               .271,  .115,  .208,  .402,  .222,  .243,  .157,  .267,  .138,  .265,  .312,  .252,  .421,  1,  .512,  .496,  .309,  .292,  .357,  .348,  .359;
               <br/>
               .167,  .085,  .218,  .319,  .304,  .212,  .137,  .177,  .120,  .197,  .196,  .171,  .529,  .512,  1,  .491,  .265,  .235,  .273,  .256,  .126;
               <br/>
               .172,  .186,  .208,  .302,  .184,  .168,  .186,  .240,  .219,  .343,  .331,  .254,  .460,  .496,  .491,  1,  .472,  .348,  .384,  .344,  .323;
               <br/>
               .197,  .232,  .245,  .266,  .361,  .312,  .308,  .176,  .133,  .359,  .327,  .232,  .352,  .309,  .265,  .472,  1,  .569,  .554,  .519,  .412;
               <br/>
               .257,  .356,  .259,  .283,  .395,  .344,  .381,  .245,  .184,  .411,  .286,  .369,  .258,  .292,  .235,  .348,  .569,  1,  .573,  .679,  .454;
               <br/>
               .256,  .363,  .336,  .267,  .407,  .308,  .248,  .154,  .236,  .454,  .414,  .377,  .216,  .357,  .273,  .384,  .554,  .573,  1,  .643,  .425;
               <br/>
               .258,  .360,  .222,  .203,  .352,  .318,  .344,  .211,  .266,  .384,  .316,  .390,  .210,  .348,  .256,  .344,  .519,  .679,  .643,  1,  .519;
               <br/>
               .253,  .285,  .277,  .238,  .313,  .417,  .318,  .134,  .089,  .333,  .343,  .290,  .188,  .359,  .126,  .323,  .412,  .454,  .425,  .519,  1}.
              </p>
              <p>
               call eigen (cr,eigvect,eigval).
               <br/>
               compute loadings = eigvect * sqrt(mdiag(eigval)).
               <br/>
               compute fm = make(nrow(cr),2,-9999).
               <br/>
               compute fm(1,2) = (mssq(cr)-ncol(cr))/(ncol(cr)*(ncol(cr)-1)).
               <br/>
               loop #m = 1 to ncol(cr) – 1.
               <br/>
               compute a = loadings(:,1:#m).
               <br/>
               compute partcov = cr – (a * t(a)).
               <br/>
               compute d = mdiag( 1 / (sqrt(diag(partcov))) ).
               <br/>
               compute pr = d * partcov * d.
               <br/>
               compute fm(#m+1,2) = (mssq(pr)-ncol(cr))/(ncol(cr)*(ncol(cr)-1)).
               <br/>
               end loop.
               <br/>
               * identifying the smallest fm value &amp; its location (= # factors).
               <br/>
               compute minfm = fm(1,2).
               <br/>
               compute nfactors = 0.
               <br/>
               loop #s = 1 to nrow(fm).
               <br/>
               compute fm(#s,1) = #s -1.
               <br/>
               do if ( fm(#s,2) &lt; minfm ).
               <br/>
               compute minfm = fm(#s,2).
               <br/>
               compute nfactors = #s – 1.
               <br/>
               end if.
               <br/>
               end loop.
               <br/>
               print /title="Velicer's Minimum Average Partial (MAP) Test:".
               <br/>
               print eigval  /title="Eigenvalues" /format "f12.6".
               <br/>
               print fm /title="Velicer's Average Squared Correlations"/format "f12.6".
               <br/>
               print minfm/title="The smallest average squared correlation is"/format "f12.6".
               <br/>
               print nfactors /title="The number of components is".
               <br/>
               end matrix.
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-210552">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2006年10月19日 下午12:00
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/2226/#post-210552">
               2 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-210552 -->
            <div class="even bbp-parent-forum-997 bbp-parent-topic-2226 bbp-reply-position-2 user-id-3142 topic-author post-210552 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/3142/" rel="nofollow" title="查看cartoon的档案">
               <img src="http://sdn.geekzu.org/avatar/0f8fbfae31d30bb6d0b5e733e2361a2f?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/3142/" rel="nofollow" title="查看cartoon的档案">
               cartoon
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               A Parallel Analysis Syntax
               <br/>
               好不容易找到了这个程序，非常简单。只需要在get data 的file语句把自己spss文件的路径和名称改一下，然后在VAR = 后面写上进行因素分析的变量名称就可以了。
              </p>
              <p>
               后面还有一个选择PCA和PA的项目，然后就搞定。
              </p>
              <p>
               * Parallel Analysis Program For Raw Data and Data Permutations.
               <br/>
               * This program conducts parallel analyses on data files in which
               <br/>
               the rows of the data matrix are cases/individuals and the
               <br/>
               columns are variables;  Data are read/entered into the program
               <br/>
               using the GET command (see the GET command below);  The GET
               <br/>
               command reads an SPSS systemfile, which can be either the
               <br/>
               current, active SPSS data file or a previously saved systemfile;
               <br/>
               A valid filename/location must be specified on the GET command;
               <br/>
               A subset of variables for the analyses can be specified by using
               <br/>
               the "/ VAR =" subcommand with the GET statement;  There can be
               <br/>
               no missing values.
               <br/>
               * You must also specify:
               <br/>
               — the # of parallel data sets for the analyses;
               <br/>
               — the desired percentile of the distribution and random
               <br/>
               data eigenvalues;
               <br/>
               — whether principal components analyses or principal axis/common
               <br/>
               factor analysis are to be conducted, and
               <br/>
               — whether normally distributed random data generation or
               <br/>
               permutations of the raw data set are to be used in the
               <br/>
               parallel analyses.
               <br/>
               * WARNING: Permutations of the raw data set are time consuming;
               <br/>
               Each parallel data set is based on column-wise random shufflings
               <br/>
               of the values in the raw data matrix using Castellan's (1992,
               <br/>
               BRMIC, 24, 72-77) algorithm; The distributions of the original
               <br/>
               raw variables are exactly preserved in the shuffled versions used
               <br/>
               in the parallel analyses; Permutations of the raw data set are
               <br/>
               thus highly accurate and most relevant, especially in cases where
               <br/>
               the raw data are not normally distributed or when they do not meet
               <br/>
               the assumption of multivariate normality (see Longman &amp; Holden,
               <br/>
               1992, BRMIC, 24, 493, for a Fortran version); If you would
               <br/>
               like to go this route, it is perhaps best to (1) first run a
               <br/>
               normally distributed random data generation parallel analysis to
               <br/>
               familiarize yourself with the program and to get a ballpark
               <br/>
               reference point for the number of factors/components;
               <br/>
               (2) then run a permutations of the raw data parallel analysis
               <br/>
               using a small number of datasets (e.g., 10), just to see how long
               <br/>
               the program takes to run; then (3) run a permutations of the raw
               <br/>
               data parallel analysis using the number of parallel data sets that
               <br/>
               you would like use for your final analyses; 100 datasets are
               <br/>
               usually sufficient, although more datasets should be used if
               <br/>
               there are close calls.
              </p>
              <p>
               * These next commands generate artificial raw data
               <br/>
               (50 cases) that can be used for a trial-run of
               <br/>
               the program, instead of using your own raw data;
               <br/>
               Just select and run this whole file; However, make sure to
               <br/>
               delete these commands before attempting to run your own data.
               <br/>
               * Enter the name/location of the data file for analyses after "FILE =";
               <br/>
               If you specify "FILE = *", then the program will read the current,
               <br/>
               active SPSS data file;  You can alternatively enter the name/location
               <br/>
               of a previously saved SPSS systemfile instead of "*";
               <br/>
               you can use the "/ VAR =" subcommand after "/ missing=omit"
               <br/>
               subcommand to select variables for the analyses.
              </p>
              <p>
               set mxloops=9000 printback=off width=80  seed = 1953125.
               <br/>
               matrix.
               <br/>
               GET raw
               <br/>
               / FILE = 'g:\twojobs.sav'
               <br/>
               / missing=omit / VAR = gwa02lev gwa03lev gwa05lev gwa07lev gwa10lev gwa11lev gwa12lev gwa16lev gwa17lev gwa18lev gwa20lev gwa22lev gwa26lev gwa27lev gwa28lev gwa29lev gwa34lev gwa35lev gwa36lev gwa37lev gwa38lev.
               <br/>
               * Enter the desired number of parallel data sets here.
               <br/>
               compute ndatsets = 100.
               <br/>
               * Enter the desired percentile here.
               <br/>
               compute percent  = 95.
               <br/>
               * Enter either
               <br/>
               1 for principal components analysis, or
               <br/>
               2 for principal axis/common factor analysis.
               <br/>
               compute kind = 1 .
               <br/>
               * Enter either
               <br/>
               1 for normally distributed random data generation parallel analysis, or
               <br/>
               2 for permutations of the raw data set (VERY time consuming).
               <br/>
               compute randtype = 1.
               <br/>
               * End of required user specifications.
              </p>
              <p>
               compute ncases   = nrow(raw).
               <br/>
               compute nvars    = ncol(raw).
               <br/>
               * principal components analysis &amp; random normal data generation.
               <br/>
               do if (kind = 1 and randtype = 1).
               <br/>
               compute nm1 = 1 / (ncases-1).
               <br/>
               compute vcv = nm1 * (sscp(raw) – ((t(csum(raw))*csum(raw))/ncases)).
               <br/>
               compute d = inv(mdiag(sqrt(diag(vcv)))).
               <br/>
               compute realeval = eval(d * vcv * d).
               <br/>
               compute evals = make(nvars,ndatsets,-9999).
               <br/>
               loop #nds = 1 to ndatsets.
               <br/>
               compute x = sqrt(2 * (ln(uniform(ncases,nvars)) * -1) ) &amp;*
               <br/>
               cos(6.283185 * uniform(ncases,nvars) ).
               <br/>
               compute vcv = nm1 * (sscp(x) – ((t(csum(x))*csum(x))/ncases)).
               <br/>
               compute d = inv(mdiag(sqrt(diag(vcv)))).
               <br/>
               compute evals(:,#nds) = eval(d * vcv * d).
               <br/>
               end loop.
               <br/>
               end if.
               <br/>
               * principal components analysis &amp; raw data permutation.
               <br/>
               do if (kind = 1 and randtype = 2).
               <br/>
               compute nm1 = 1 / (ncases-1).
               <br/>
               compute vcv = nm1 * (sscp(raw) – ((t(csum(raw))*csum(raw))/ncases)).
               <br/>
               compute d = inv(mdiag(sqrt(diag(vcv)))).
               <br/>
               compute realeval = eval(d * vcv * d).
               <br/>
               compute evals = make(nvars,ndatsets,-9999).
               <br/>
               loop #nds = 1 to ndatsets.
               <br/>
               compute x = raw.
               <br/>
               loop #c = 1 to nvars.
               <br/>
               loop #r = 1 to (ncases -1).
               <br/>
               compute k = trunc( (ncases – #r + 1) * uniform(1,1) + 1 )  + #r – 1.
               <br/>
               compute d = x(#r,#c).
               <br/>
               compute x(#r,#c) = x(k,#c).
               <br/>
               compute x(k,#c) = d.
               <br/>
               end loop.
               <br/>
               end loop.
               <br/>
               compute vcv = nm1 * (sscp(x) – ((t(csum(x))*csum(x))/ncases)).
               <br/>
               compute d = inv(mdiag(sqrt(diag(vcv)))).
               <br/>
               compute evals(:,#nds) = eval(d * vcv * d).
               <br/>
               end loop.
               <br/>
               end if.
               <br/>
               * PAF/common factor analysis &amp; random normal data generation.
               <br/>
               do if (kind = 2 and randtype = 1).
               <br/>
               compute nm1 = 1 / (ncases-1).
               <br/>
               compute vcv = nm1 * (sscp(raw) – ((t(csum(raw))*csum(raw))/ncases)).
               <br/>
               compute d = inv(mdiag(sqrt(diag(vcv)))).
               <br/>
               compute cr = (d * vcv * d).
               <br/>
               compute smc = 1 – (1 &amp;/ diag(inv(cr)) ).
               <br/>
               call setdiag(cr,smc).
               <br/>
               compute realeval = eval(cr).
               <br/>
               compute evals = make(nvars,ndatsets,-9999).
               <br/>
               compute nm1 = 1 / (ncases-1).
               <br/>
               loop #nds = 1 to ndatsets.
               <br/>
               compute x = sqrt(2 * (ln(uniform(ncases,nvars)) * -1) ) &amp;*
               <br/>
               cos(6.283185 * uniform(ncases,nvars) ).
               <br/>
               compute vcv = nm1 * (sscp(x) – ((t(csum(x))*csum(x))/ncases)).
               <br/>
               compute d = inv(mdiag(sqrt(diag(vcv)))).
               <br/>
               compute r = d * vcv * d.
               <br/>
               compute smc = 1 – (1 &amp;/ diag(inv(r)) ).
               <br/>
               call setdiag(r,smc).
               <br/>
               compute evals(:,#nds) = eval(r).
               <br/>
               end loop.
               <br/>
               end if.
               <br/>
               * PAF/common factor analysis &amp; raw data permutation.
               <br/>
               do if (kind = 2 and randtype = 2).
               <br/>
               compute nm1 = 1 / (ncases-1).
               <br/>
               compute vcv = nm1 * (sscp(raw) – ((t(csum(raw))*csum(raw))/ncases)).
               <br/>
               compute d = inv(mdiag(sqrt(diag(vcv)))).
               <br/>
               compute cr = (d * vcv * d).
               <br/>
               compute smc = 1 – (1 &amp;/ diag(inv(cr)) ).
               <br/>
               call setdiag(cr,smc).
               <br/>
               compute realeval = eval(cr).
               <br/>
               compute evals = make(nvars,ndatsets,-9999).
               <br/>
               compute nm1 = 1 / (ncases-1).
               <br/>
               loop #nds = 1 to ndatsets.
               <br/>
               compute x = raw.
               <br/>
               loop #c = 1 to nvars.
               <br/>
               loop #r = 1 to (ncases -1).
               <br/>
               compute k = trunc( (ncases – #r + 1) * uniform(1,1) + 1 )  + #r – 1.
               <br/>
               compute d = x(#r,#c).
               <br/>
               compute x(#r,#c) = x(k,#c).
               <br/>
               compute x(k,#c) = d.
               <br/>
               end loop.
               <br/>
               end loop.
               <br/>
               compute vcv = nm1 * (sscp(x) – ((t(csum(x))*csum(x))/ncases)).
               <br/>
               compute d = inv(mdiag(sqrt(diag(vcv)))).
               <br/>
               compute r = d * vcv * d.
               <br/>
               compute smc = 1 – (1 &amp;/ diag(inv(r)) ).
               <br/>
               call setdiag(r,smc).
               <br/>
               compute evals(:,#nds) = eval(r).
               <br/>
               end loop.
               <br/>
               end if.
               <br/>
               * identifying the eigenvalues corresponding to the desired percentile.
               <br/>
               compute num = rnd((percent*ndatsets)/100).
               <br/>
               compute results = { t(1:nvars), realeval, t(1:nvars), t(1:nvars) }.
               <br/>
               loop #root = 1 to nvars.
               <br/>
               compute ranks = rnkorder(evals(#root,:)).
               <br/>
               loop #col = 1 to ndatsets.
               <br/>
               do if (ranks(1,#col) = num).
               <br/>
               compute results(#root,4) = evals(#root,#col).
               <br/>
               break.
               <br/>
               end if.
               <br/>
               end loop.
               <br/>
               end loop.
               <br/>
               compute results(:,3) = rsum(evals) / ndatsets.
               <br/>
               print /title="PARALLEL ANALYSIS:".
               <br/>
               do if (kind = 1 and randtype = 1).
               <br/>
               print /title="Principal Components &amp; Random Normal Data Generation".
               <br/>
               else if (kind = 1 and randtype = 2).
               <br/>
               print /title="Principal Components &amp; Raw Data Permutation".
               <br/>
               else if (kind = 2 and randtype = 1).
               <br/>
               print /title="PAF/Common Factor Analysis &amp; Random Normal Data Generation".
               <br/>
               else if (kind = 2 and randtype = 2).
               <br/>
               print /title="PAF/Common Factor Analysis &amp; Raw Data Permutation".
               <br/>
               end if.
               <br/>
               compute specifs = {ncases; nvars; ndatsets; percent}.
               <br/>
               print specifs /title="Specifications for this Run:"
               <br/>
               /rlabels="Ncases" "Nvars" "Ndatsets" "Percent".
               <br/>
               print results
               <br/>
               /title="Raw Data Eigenvalues, &amp; Mean &amp; Percentile Random Data Eigenvalues"
               <br/>
               /clabels="Root" "Raw Data" "Means" "Prcntyle"  /format "f12.6".
               <br/>
               compute root      = results(:,1).
               <br/>
               compute rawdata = results(:,2).
               <br/>
               compute percntyl = results(:,4).
               <br/>
               save results /outfile=* / var=root rawdata means percntyl .
               <br/>
               end matrix.
               <br/>
               * plots the eigenvalues, by root, for the real/raw data and for the random data;
               <br/>
               This command works in SPSS 12, but not in all earlier versions.
               <br/>
               TSPLOT VARIABLES= rawdata means percntyl /ID= root /NOLOG.
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-210567">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2006年10月19日 下午2:12
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/2226/#post-210567">
               3 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-210567 -->
            <div class="odd bbp-parent-forum-997 bbp-parent-topic-2226 bbp-reply-position-3 user-id-1 post-210567 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               谢益辉
              </a>
              <br/>
              <div class="bbp-author-role">
               站长
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               这个……我更需要的是数理统计原理……程序看起来太痛苦了
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-210574">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2006年10月19日 下午3:32
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/2226/#post-210574">
               4 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-210574 -->
            <div class="even bbp-parent-forum-997 bbp-parent-topic-2226 bbp-reply-position-4 user-id-3142 topic-author post-210574 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/3142/" rel="nofollow" title="查看cartoon的档案">
               <img src="http://sdn.geekzu.org/avatar/0f8fbfae31d30bb6d0b5e733e2361a2f?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/3142/" rel="nofollow" title="查看cartoon的档案">
               cartoon
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               那就要请你帮忙了……
               <br/>
               国内查不到……
               <br/>
               我也希望能看到……
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-210614">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2006年10月20日 上午10:40
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/2226/#post-210614">
               5 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-210614 -->
            <div class="odd bbp-parent-forum-997 bbp-parent-topic-2226 bbp-reply-position-5 user-id-1 post-210614 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               谢益辉
              </a>
              <br/>
              <div class="bbp-author-role">
               站长
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               好吧，我去搜一搜：）
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-212582">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2006年11月17日 上午2:21
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/2226/#post-212582">
               6 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-212582 -->
            <div class="even bbp-parent-forum-997 bbp-parent-topic-2226 bbp-reply-position-6 user-id-3142 topic-author post-212582 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/3142/" rel="nofollow" title="查看cartoon的档案">
               <img src="http://sdn.geekzu.org/avatar/0f8fbfae31d30bb6d0b5e733e2361a2f?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/3142/" rel="nofollow" title="查看cartoon的档案">
               cartoon
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               结果如何？
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-212653">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2006年11月17日 下午3:37
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/2226/#post-212653">
               7 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-212653 -->
            <div class="odd bbp-parent-forum-997 bbp-parent-topic-2226 bbp-reply-position-7 user-id-1 post-212653 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               谢益辉
              </a>
              <br/>
              <div class="bbp-author-role">
               站长
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               不好意思，似乎不太好找……
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
           </li>
           <!-- .bbp-body -->
           <li class="bbp-footer">
            <div class="bbp-reply-author">
             作者
            </div>
            <div class="bbp-reply-content">
             帖子
            </div>
            <!-- .bbp-reply-content -->
           </li>
           <!-- .bbp-footer -->
          </ul>
          <!-- #topic-2226-replies -->
          <div class="bbp-pagination">
           <div class="bbp-pagination-count">
            查看 7 个帖子 - 1 到 7（总计 7 个）
           </div>
           <div class="bbp-pagination-links">
           </div>
          </div>
          <div class="bbp-no-reply" id="no-reply-2226">
           <div class="bbp-template-notice">
            <p>
             您必须先登录才能回复该主题。
            </p>
           </div>
          </div>
         </div>
        </div>
        <!-- .entry-content -->
        <footer class="entry-meta">
        </footer>
        <!-- .entry-meta -->
       </article>
       <!-- #post -->
       <div class="comments-area" id="comments">
       </div>
       <!-- #comments -->
      </div>
      <!-- #content -->
     </div>
     <!-- #primary -->
     <div class="sidebar-container" id="tertiary" role="complementary">
      <div class="sidebar-inner">
       <div class="widget-area">
        <aside class="widget bbp_widget_login" id="bbp_login_widget-2">
         <h3 class="widget-title">
          登录
         </h3>
         <form action="http://cos.name/cn/wp-login.php" class="bbp-login-form" method="post">
          <fieldset>
           <legend>
            登录
           </legend>
           <div class="bbp-username">
            <label for="user_login">
             用户名:
            </label>
           </div>
           <div class="bbp-password">
            <label for="user_pass">
             密码:
            </label>
           </div>
           <div class="bbp-remember-me">
            <label for="rememberme">
             记住用户名
            </label>
           </div>
           <div class="bbp-submit-wrapper">
            <button class="button submit user-submit" id="user-submit" name="user-submit" tabindex="104" type="submit">
             登录
            </button>
           </div>
           <div class="bbp-login-links">
            <a class="bbp-register-link" href="http://cos.name/cn/wp-login.php?action=register" title="注册">
             注册
            </a>
            <a class="bbp-lostpass-link" href="http://cos.name/cn/wp-login.php?action=lostpassword" title="忘记密码">
             忘记密码
            </a>
           </div>
          </fieldset>
         </form>
        </aside>
        <aside class="widget widget_text" id="text-7">
         <h3 class="widget-title">
          搜索
         </h3>
         <div class="textwidget">
          <form action="http://www.google.com/search" id="bbp-search-form" method="get" onsubmit="Gsitesearch(this)" role="search">
           <div>
           </div>
          </form>
          <form id="bbp-search-form-baidu" onsubmit="g(this)" role="search">
           <div>
           </div>
          </form>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-2">
         <h3 class="widget-title">
          新鲜事
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <a href="http://cos.name/cn/topics/">
             最新帖子
            </a>
           </li>
           <li>
            <a href="http://cos.name/cn/view/popular/">
             最热门主题
            </a>
           </li>
           <li>
            <a href="http://cos.name/cn/view/no-replies/">
             消灭零回复
            </a>
           </li>
          </ul>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-3">
         <h3 class="widget-title">
          RSS订阅
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <img src="http://cos.name/wp-includes/images/rss.png"/>
            <a href="http://cos.name/cn/topics/feed/">
             所有主题
            </a>
           </li>
           <li>
            <img src="http://cos.name/wp-includes/images/rss.png"/>
            <a href="http://cos.name/cn/forums/feed/">
             所有帖子
            </a>
           </li>
          </ul>
         </div>
        </aside>
       </div>
       <!-- .widget-area -->
      </div>
      <!-- .sidebar-inner -->
     </div>
     <!-- #tertiary -->
    </div>
    <!-- #main -->
    <footer class="site-footer" id="colophon" role="contentinfo">
     <div class="site-info">
      版权所有 © 2014 统计之都 | 由
      <a href="http://wordpress.org/">
       WordPress
      </a>
      构建 | 主题修改自
      <a href="http://wordpress.org/themes/twentythirteen">
       Twenty Thirteen
      </a>
     </div>
     <!-- .site-info -->
    </footer>
    <!-- #colophon -->
   </div>
   <!-- #page -->
  </div>
 </body>
</html>